package com.itheima.springbootwebtlias.service.Impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.springbootwebtlias.mapper.LogMapper;
import com.itheima.springbootwebtlias.pojo.PageResult;
import com.itheima.springbootwebtlias.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper logMapper;

    @Override
    public PageResult page(Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        Page p2 = (Page) logMapper.selectByCondition();

        PageResult pageResult = new PageResult(p2.getTotal(),p2.getResult());
        return pageResult;
    }
}
